package com.kitty.factory;

public class FruitFactory {
	public static final int BANANA_TYPE = 0;
	public static final int ORANGE_TYPE = 2;
	public static final int APPLE_TYPE = 4;
	
	 
	
	public static Fruit getFruit(int fruitType) {
		 if (fruitType == BANANA_TYPE) {
			 return new Banana();
		 } else if (fruitType == ORANGE_TYPE) {
			 return new Orange();
		 } else if (fruitType == APPLE_TYPE) {
			 return new Apple();
		 } else {
			 throw new IllegalArgumentException("" + fruitType);
		 }
	}
	
}
